import {
MenuFoldOutlined,
MenuUnfoldOutlined,
UploadOutlined,
UserOutlined,
VideoCameraOutlined,
} from '@ant-design/icons';
import Layout from "@/pages/layout/index";
import Login from "@/pages/login/index";
import Dashboard from "@/pages/dashboard/index"
import GoodList from "@/pages/good/goodList"
import GoodForm from "@/pages/good/goodForm"
import User from "@/pages/user/index"
import { FormattedMessage } from 'react-intl';

export const constantRoutes=[
    {path:"/",element:<Layout />,children:[]},
    {path:"/login",element:<Login />,children:[]},
]

// 动态路由，有权限的路由
export const asyncRoutes = [
    {
        key: 1001,
        path: "/dashboard",
        label: <FormattedMessage id='menu.dashboard'/>,
        icon: <MenuFoldOutlined />,
        element: <Dashboard />,
        meta:{
            roles:["admin","editor"]
        }
    },
    {
        key: 1002,
        icon: <VideoCameraOutlined />,
        label: <FormattedMessage id='menu.good'/>,
        meta:{
            roles:["admin","editor"]
        },
        children: [
            {
                key: 100201,
                path: "/good/list",
                icon: null,
                label: <FormattedMessage id='menu.good.list'/>,
                element: <GoodList />
            },
            {
                key: 100202,
                path: "/good/add",
                icon: null,
                label: <FormattedMessage id='menu.good.add'/>,
                element: <GoodForm />,
                hidden:true,
            },
            {
                key: 100203,
                path: "/good/edit/:id",
                icon: null,
                label: <FormattedMessage id='menu.good.edit'/>,
                element: <GoodForm />,
                hidden:true,
            }
        ]
    },
    {
        key: 1003,
        path: "/user",
        element: <User />,
        icon: <UserOutlined />,
        label: <FormattedMessage id='menu.user'/>,
        meta:{
            roles:["admin","editor"]
        }
    }
];